

#快排代码
def quick_sort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[0]
    left = []        # 左边的数组
    right = []       # 右边的数组
    for i in range(1, len(arr)):
        if arr[i] < pivot:
            left.append(arr[i])
        else:
            right.append(arr[i])
    return quick_sort(left) + [pivot] + quick_sort(right)

arr = [3, 7, 2, 5, 1, 4]
print(quick_sort(arr))